rm(list=ls())
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Tables/Combined_Table.csv")
# pre-processing
df <- data.frame(df)
### add sig at .05
df$sig_05 <- ifelse(df$pv<0.05,1,0)
df$sig_05 <- as.factor(df$sig_05)
## plot
library(ggplot2)
cbPalette <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#000000")
ggplot(data = df, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
#### Subset balance plot just to demographic variables
df_dem <- subset(df,df$Hyp=="Demographic")
png("BalancePlot_DemVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_dem, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures/BalancePlot_DemVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_dem, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
ggplot(data = df_dem, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
#### Subset balance plot just to demographic variables
df_other <- subset(df,df$Hyp!="Demographic")
ggplot(data = df_other, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Generating P-value plots (Balance checks)
rm(list=ls())
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Tables/Combined_Table.csv")
# pre-processing
df <- data.frame(df)
### add sig at .05
df$sig_05 <- ifelse(df$pv<0.05,1,0)
df$sig_05 <- as.factor(df$sig_05)
## plot
library(ggplot2)
cbPalette <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#000000")
setwd("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures")
png("BalancePlot_AllVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
#### Subset balance plot just to demographic variables
df_dem <- subset(df,df$Hyp=="Demographic")
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures/BalancePlot_DemVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_dem, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
#### Subset balance plot just to demographic variables
df_other <- subset(df,df$Hyp!="Demographic")
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures/BalancePlot_ControlVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_other, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
####
#### Eroll Kuhn & Rahsaan Maxwell
#### Generating P-value plots (Balance checks)
rm(list=ls())
# read in frame
df <- read.csv("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Tables/Combined_Table.csv")
# pre-processing
df <- data.frame(df)
### add sig at .05
df$sig_05 <- ifelse(df$pv<0.05,1,0)
df$sig_05 <- as.factor(df$sig_05)
## plot
library(ggplot2)
cbPalette <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#000000")
#### Subset balance plot just to demographic variables
df_dem <- subset(df,df$Hyp=="Demographic")
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures/BalancePlot_DemVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_dem, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
#### Subset balance plot just to demographic variables
df_other <- subset(df,df$Hyp!="Demographic")
png("/Users/erollkuhn/Dropbox (Personal)/Refugee Context Project/Clean Code V7/2.Balance Checks/SoepRemote Output/Figures/BalancePlot_ControlVars.png",
width=10,height=6,units='in',res=300)
ggplot(data = df_other, aes(x = pv, y = Variable,shape=sig_05)) +
facet_wrap(~Outcome) +
geom_vline(xintercept = 0.05, lty = 2) +
geom_point(size = 2) +
ylab(NULL) +
xlab(expression(paste(italic("p"), "-value", sep=""))) +
theme_bw() +
theme(panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
legend.position = "none",
panel.grid.major.y = element_line(size = .15, linetype = 2, color = "gray75"))
dev.off()
